package com.wimcorp.magic.host;

import java.util.Collection;
import java.util.Set;

import com.wimcorp.magic.abilities.Ability;
import com.wimcorp.magic.board.CardType;
import com.wimcorp.magic.cards.PlayingCard;
import com.wimcorp.magic.players.Player;

public class AbilityInputValidator {
	private Player player;
	private long identifier;

	public AbilityInputValidator(Player player, long identifier) {
		this.player = player;
		this.identifier = identifier;
	}

	public boolean isValid() {
		Collection<PlayingCard> cards = player.getSummoningPlaines().getCards(CardType.ALL);
		for (PlayingCard card : cards) {
			Set<Ability> abilities = card.getAbilities();
			for(Ability ability : abilities){
				if(ability.getIdentifier() == identifier){
					return true;
				}
			}
		}
		return false;
	}

}
